/*
	The directives starting with # below ensures that this file is read by the compiler only once
	even if it is #included several times. It is call an "include guard"
*/
#ifndef ORDER_H_
#define ORDER_H_

//other types
#include "Date.h"				//uncomment once you have added the type definition
#include "Time.h"				//uncomment once you have added the type definition
#include <string>
#include <vector>
using namespace std;

struct Order {
public:
	//data

	// constructors
	Order() {} //Ecky C3
	Order (int ord_id, int serv_id, int tab_id,int year, int month, int day, int hour, int minute);//JTL A2
	
	//Ecky C3
	inline friend std::istream& operator>> (std::istream& in, Order& oi) 
	{ 
        return in >> oi.order_id >> oi.server_id >> oi.table_id >> oi.order_date >> oi.order_time; 
    }

	//Ecky C3
    inline friend std::ostream& operator<< (std::ostream& os, Order const& oi) 
	{ 
        return os << oi.order_id << " " << oi.server_id << " " << oi.table_id << " " << oi.order_date << " " << oi.order_time;
    }

   // utility functions
	void display();//JTL A2
	int get_order_id();
	int get_server_id();
	int get_table_id();
	int getId() { return order_id; }
private:
   //constants

   // private data
	int order_id;
	int server_id;
	int table_id;
	Date order_date;	//uncomment once you have added the type definition
	Time order_time;  //uncomment once you have added the type definition
};

void read_order(vector<Order>& orders,string file);

#endif //ORDER_H_
